package com.group.library.order.controller.admin;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;

/**
 * Author: Lai
 * Email: ayong1324@163.com
 * Time: 2022年5月12日16:59:15
 * Description: 控制后台页面的跳转
 */

@Controller
@RequestMapping("/admin/page")
public class PageJumpController {

    @GetMapping("/login")
    public String toLogin(){
        return "admin-login";
    }

    @GetMapping("/index")
    public String toIndex(HttpSession session) {
        System.out.println("session's admin-->"+session.getAttribute("admin"));
        if(session.getAttribute("admin")!=null)
            return "admin-index";
        return "admin-login";
    }

    @GetMapping("/addAdmin")
    public String toAddAdmin(){
        return "admin-add";
    }

    @GetMapping("/adminManage")
    public String toAdminManage(){
        return "admin-manage";
    }

    @GetMapping("/userManage")
    public String toUserManage(){
        return "user-manage";
    }
    @GetMapping("/orderManage")
    public String toOrderManage(){
        return "order-manage";
    }
    @GetMapping("/seatManage")
    public String toSeatManage(){
        return "seat-manage";
    }

    @GetMapping("/welcome")
    public String toWelcome(){
        return "welcome";
    }

    @GetMapping("/userReport")
    public String toUserReport(){
        return "user-report";
    }

    @GetMapping("/userAdvice")
    public String toUserAdvice(){
        return "user-advice";
    }

    @GetMapping("/addNotice")
    public String toAddNotice(){
        return "notice-add";
    }

    @GetMapping("/noticeManage")
    public String toNoticeManage(){
        return "notice-manage";
    }

}
